---
title: "Accessibility Checker Rule Help: WCAG20_Html_HasLang"
---
import "../../../styles/ToolHelp.scss"
import { CodeSnippet, Tag } from "carbon-components-react";

<div className="toolHelp">
<Row>
<Column colLg={16} colMd={8} colSm={4} className="toolHead">

### The HTML page does not identify its default language with a `lang` attribute

<div id="locLevel"></div>

Page must identify the default language of the document with a `lang` attribute

</Column>
</Row>
<Row>
<Column colLg={11} colMd={5} colSm={4} className="toolMain">

### Why is this important?

Speech synthesizers that support multiple languages can adapt to the pronunciation and syntax that are specific to the language, speaking the text in the correct language with proper pronunciation. Some screen readers can be configured to automatically switch languages based on the `lang` attribute.

<div id="locSnippet"></div>

### What to do

* Identify the default language of the HTML document by providing the `lang` attribute on the HTML element (e.g. `<html lang="en">`);
* OR, if serving an XML document only (ie. using a MIME type such as application/xhtml+xml), identify the default language by providing the `xml:lang` attribute alone. The `lang` attribute is not needed (`<html xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">`)
* OR, if serving XHTML 1.x or polyglot pages as text/html, use both the `lang` attribute and the `xml:lang` attribute and ensure the values for both atttributes are identical (`<html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">`)

</Column>
<Column colLg={5} colMd={3} colSm={4} className="toolLeft">

### About this requirement

[IBM 3.1.1 Language of Page](http://www.ibm.com/able/guidelines/ci162/language_of_page.html)
[WCAG 2.1 technique H57](https://www.w3.org/WAI/WCAG21/Techniques/html/H57)

### Who does this affect?

* Blind people using screen readers
* People with dyslexia

</Column>
</Row>
</div>

export default ({ children, _frontmatter }) => (<React.Fragment>{children}</React.Fragment>)
